<?php

namespace app\common\validate;

use think\Validate;

class MemberFundAccount extends Validate
{
    protected $rule = [
        'householder' => 'require',
        'cert_id' => 'require|checkCardNo',
        'account' => 'require',
        'phone' => ['regex'=>'/^1[3|4|5|7|8][0-9]\d{4,8}$/i', 'require'],
        'type' => 'in:1,2,3',
    ];

    protected $message = [
        'account.require'=>  400132,
        'cert_id.require'=>  400097,
        'cert_id.checkCardNo'=>  400137,
        'type.in'=>  400131,
        'phone.regex'=>  400100,
        'phone.require'=>  400106,
        'householder.require'=>  400133,
    ];

    // 自定义验证规则
    protected function checkCardNo($value)
    {
        return checkCardNo($value);
    }
}